<template>
  <div class="container_common capitalRecordsDetail">
    <van-cell title="金额" class="money">
      <div slot="default" class="size18 blue_text" v-if="type=='withdrawCoin'">
        <span
          class="size18 blue_text"
          v-if="list.currency.indexOf('USDT')>=0"
        >{{list.balance|SubString(4)}} USDT</span>
        <span class="size18 blue_text" v-else>{{list.balance|SubString(4)}} {{list.currency}}</span>
      </div>
      <div slot="default" class="size18 blue_text" v-else>
        <span
          class="size18 blue_text"
          v-if="list.currency.indexOf('USDT')>=0"
        >{{list.fee|SubString(4)}} USDT</span>
        <span class="size18 blue_text" v-else>{{list.fee|SubString(4)}} {{list.currency}}</span>
      </div>
    </van-cell>
    <van-cell-group class="moneyBox c222">
      <van-cell title="类型">
        <div slot="default" v-if="type=='transfer'" class="eils">
          <!-- <span v-if="list.type =='BALANCE_MOVE_TOKEN'">币币账户划转到合约账户</span>
          <span v-if="list.type =='BALANCE_MOVE_ASSETS'">币币账户划转到充提账户</span>
          <span v-if="list.type =='BALANCE_MOVE_FB'">币币账户划转到法币账户</span>
          <span v-if="list.type =='TOKEN_MOVE_BALANCE'">合约账户划转到币币账户</span>
          <span v-if="list.type =='TOKEN_MOVE_FB'">合约账户划转到法币账户</span>
          <span v-if="list.type =='TOKRN_MOVE_ASSETS'">合约账户划转到充提账户</span>
          <span v-if="list.type =='FB_MOVE_BALANCE'">法币账户划转到币币账户</span>
          <span v-if="list.type =='FB_MOVE_TOKEN'">法币账户划转到合约账户</span>
          <span v-if="list.type =='FB_MOVE_ASSETS'">法币账户划转到充提账户</span>
          <span v-if="list.type =='ASSETS_MOVE_BALANCE'">充提账户划转到币币账户</span>
          <span v-if="list.type =='ASSETS_MOVE_FB'">充提账户划转到法币账户</span>
          <span v-if="list.type =='ASSETS_MOVE_TOKEN'">充提账户划转到合约账户</span> -->
          <span v-if="list.type =='SQKD_MOVE_FB'" class="eils c666">淘金客划转OTC</span>
          <span v-if="list.type =='OTC_MOVE_SQKD'" class="eils c666">OTC划转淘金客</span>
        </div>
        <div slot="default" v-else class="eils">
          <span>{{list.type}}</span>
        </div>        
        <div class="statusBtn">
          <span class="span err" v-if="list.state==2">失败</span>
          <span class="span sucess" v-if="list.state==1">成功</span>
        </div>
      </van-cell>
      <!-- <van-cell title="人民币金额（预估）">
        <span slot="default">+{{100.00|SubString(4)}} CNY</span>
      </van-cell>
      <van-cell title="人民币金额（实际）">
        <span slot="default">+{{100.00|SubString(4)}} CNY</span>
      </van-cell>
      <van-cell title="银行卡" value="-" />-->
      <!-- 提笔记录 -->

      <van-cell title="提币地址" v-if="type=='withdrawCoin'">
        <span>{{list.wallet}}</span>
      </van-cell>

      <van-cell title="充币地址" v-if="type=='coinCharging'">
        <span>{{list.wallet}}</span>
      </van-cell>

      <van-cell title="状态" v-if="type=='withdrawCoin'">
        <span v-if="list.state=='REJECT'">失败</span>
        <span v-if="list.state=='PASS'">成功</span>
        <span v-if="list.state=='CREATE'">进行中</span>
      </van-cell>

      <van-cell title="手续费" v-if="type=='withdrawCoin' ">
        <span v-if="list.currency.indexOf('USDT')>=0">{{list.handlingFee|SubString(4)}} USDT</span>
        <span v-else>{{list.handlingFee}} {{list.currency}}</span>
      </van-cell>

      <!-- 充币记录 -->
      <van-cell title="状态" v-if="type=='coinCharging'">
        <span>成功</span>
      </van-cell>

      <van-cell title="时间">
        <span slot="default" v-if="type=='transfer'">{{list.createTime|yndhms}}</span>
        <span slot="default" v-else-if="type=='coinCharging'">{{list.createTime}}</span>
        <span slot="default" v-else>{{list.extractTime}}</span>
      </van-cell>
    </van-cell-group>
  </div>
</template>

<script>
import { mapActions } from "vuex";
export default {
  components: {},
  data() {
    return {
      type: "",
      list: {
        fee: "",
        balance: "",
        type: "",
        wallet: "",
        handlingFee: "",
        state: "",
        currency:''
      }
    };
  },
  methods: {
    ...mapActions([
      "setnavTitle",
      "setnavBarState",
      "settabBarState",
      "setbackRouter",
      "setnavBarArrow",
      "setnavBarBgColor",
      "setnavBarShowRight"
    ]),
    init() {
      this.setnavTitle("详细信息");
      this.setbackRouter("");
      this.setnavBarState(true);
      this.settabBarState(false);
      this.setnavBarArrow(true);
    }
  },
  mounted() {
    this.init();
    this.type = this.$GLOBAL.recordsDetail.type;
    var data = this.$GLOBAL.recordsDetail.data;
    this.list = data;
  }
};
</script>
<style lang="scss">
.capitalRecordsDetail {
  .van-cell:not(:last-child)::after {
    border: 0;
  }
  .van-hairline--top-bottom::after {
    border: 0;
  }
  .moneyBox {
    .van-cell__value {
      // color: #222222;
    }
  }
}
</style>
<style lang="scss" scoped>
@import "@/assets/scss/theme.scss";
.capitalRecordsDetail {
  height: 100%;
  @include base-background();

  padding-left: 0;
  padding-right: 0;
  .money {
    @include base-background-second();

    // background: #f8f7fd;
  }
}
</style>